/**分类缩进***/
function strRepeat(str, count) {
    var ret = "";
    for (var i = 0; i < count; i++) {
        ret += str;
    }
    return ret;
}


//时间戳转换成日期格式
function formatDate(time, long) {
    var date;
    if (time) {
        date = new Date(time);
    } else {
        date = new Date();
    }

    var Y = date.getFullYear() + '-',
        M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-',
        D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + ' ',
        h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':',
        m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':',
        s = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds());

    if (long) {
        return Y + M + D + h + m + s;
    } else {
        return Y + M + D;
    }

}